package com.imessage.service;

import com.imessage.web.Page;
import io.ebean.Expression;
import io.ebean.Query;
import io.ebean.SqlQuery;
import io.ebean.SqlRow;

import java.util.List;
import java.util.Map;

public interface BaseService {

    public <T> List<T> findList(Class<T> entityType, List<Expression> expressionList, String select, String orderby, int start, int length);

    public <T> List<T> findList(Class<T> entityType, List<Expression> expressionList, int start, int length);

    public <T> List<T> findList(Class<T> entityType, List<Expression> expressionList, String select, String orderby);

    public <T> List<T> findList(Class<T> entityType, List<Expression> expressionList);

    public <T> List<T> findList(Class<T> entityType, Expression expression, String select, String orderby);

    public <T> List<T> findList(Class<T> entityType, Expression expression);

    public <T> Page<T> findPage(Class<T> entityType, List<Expression> expressionList, String select, String orderby, int pageCurrent, int length);

    public <T> Page<T> findPage(Class<T> entityType, List<Expression> expressionList, int pageCurrent, int length);

    public <T> T findObject(Class<T> entityType, List<Expression> expressionList, String select, String orderby);

    public <T> T findObject(Class<T> entityType, List<Expression> expressionList);

    public <T> T findObject(Class<T> entityType, Expression expression, String select, String orderby);

    public <T> T findObject(Class<T> entityType, Expression expression);

    public <T> T findById(Class<T> entityType, Object id);

    public <T> Query<T> createQuery(Class<T> entityType, List<Expression> expressionList, String select, String orderby);

    public <T> Query<T> createQuery(Class<T> entityType, List<Expression> expressionList);

    public SqlQuery createSqlQuery(String sql);

    public int updateObject(Object o);

    public int saveObject(Object o);

    public int delObject(Object o);

    public void close(Object o);

    public void setSqlRow(String key, SqlRow sqlRow, Map<String, Object[]> dbMap);

    public void setSqlQuery(List<com.imessage.comm.Query> queryList, SqlQuery sqlQuery);
}
